package com.etung.iot.demo.utils;

import com.etung.iot.demo.configs.TopicConfig;

public class TopicUtil {
    public static String replaceGenPath(String exp,String productKey,String imei){
        return exp.replaceFirst("/\\+/","/"+productKey+"/").replaceFirst("/\\+/","/"+imei+"/");
    }

    public static void main(String[] args) {
        String text= "/dtu/+/+/data";
        System.out.println(text.replaceFirst("/\\+/","/1212121/"));
        System.out.println(replaceGenPath(TopicConfig.REAL_DATA_TOPIC,"{productkey}","{imei}"));
    }
}
